#! /bin/bash
HIVE_HOME=/usr/bin/hive

${HIVE_HOME} -S -e "
create table oe_dws.dws_vis_con_daycount
(
    create_time        string comment '数据创建时间',
    year_code          string comment '年,如2014',
    season             integer comment '季度',
    month_code         string comment '月份,如01',
    date_code          string comment '天',
    hour               string comment  '小时',
    area               string comment '地域',
    country            string comment '所在国家',
    province           string comment '省',
    city               string comment '城市',
    from_url           string comment '会话来源页面',
    origin_channel     string comment '投放渠道',
    seo_source         string comment '搜索来源',
    consultation_count bigint comment '咨询人数',
    visit_count       bigint comment '访问人数',
    total_users       bigint comment '访问人数',
    total_ips          bigint comment '访问IP数',
    unique_sessions    bigint comment '访问session数',
    consultation_rate decimal(22,2) comment '咨询率'
) comment '访问咨询日统计'
    partitioned by (dt string)
    row format delimited
        fields terminated by '\t'
    stored as orc
    tblproperties ('orc.compress' = 'snappy');